#! /usr/bin/env python
import cv

def compute_convex_hull(points) :

    storage = cv.CreateMemStorage(0)
    hull = cv.ConvexHull2 (points, storage, cv.CV_CLOCKWISE, 1)
    return hull 

def main():
    points = [(149, 312), (330, 338), (324, 179), (164, 142), (135, 147), (153, 217)]
    print points 
    hull = compute_convex_hull(points)
    for i in range(0, len(hull) ):
       print hull[i]

if __name__ == '__main__':
    main()
